<template>
  <div>
    <el-table
      :data="tableData"
      style="width: 100%"
      max-height="250"
      :header-cell-style="{
        background: 'rgba(11, 132, 123, 0.08)',
        color: '#000',
      }"
      @row-click="rowClick"
    >
      <el-table-column label="业务类型" align="center">
        <template slot-scope="scoep">
          <span v-if="scoep.row.name">{{
            scoep.row.name ? scoep.row.name : "--"
          }}</span>
          <span v-else>{{ scoep.row.title ? scoep.row.title : "--" }}</span>
        </template>
      </el-table-column>
      <el-table-column label="标题/事由" align="center">
        <template slot-scope="scoep">
          {{ scoep.row.content ? scoep.row.content : "--" }}
        </template>
      </el-table-column>
      <el-table-column label="发起人" align="center">
        <template slot-scope="scoep">
          {{ scoep.row.createBy ? scoep.row.createBy : "--" }}
        </template>
      </el-table-column>
      <el-table-column label="发起日期" align="center">
        <template slot-scope="scoep">
          {{ scoep.row.createTime ? scoep.row.createTime : "--" }}
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center">
        <template slot-scope="scoep">
          <el-link v-if="scoep.row.status == 0" @click="seeInfo(scoep.row)">标为已读</el-link>
          <span v-if="scoep.row.status == 2">--</span>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="listParams.pageNum"
      :limit.sync="listParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: () => [],
    },
    total: {
      type: Number,
      default: 0,
    },
    listParams: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
    };
  },
  created() {
  },

  methods: {

    seeInfo(row) {
      this.$emit("tongzhi-seeInfo", row);
    },
    getList() {
      this.$emit("tongzhi-event");
    },
    // 点击某一行
    rowClick(row, column, event) {
      console.log(row, column, event);
    },
  },
};
</script>

<style lang="scss" scoped>
.pagination-container {
  padding: 0 !important;
}
</style>
